package com.atguigu.flyweight;

public class Client {
    public static void main(String[] args) {
        //创建一个工厂类
        WebSiteFactory webSiteFactory = new WebSiteFactory();

        //客户要一个新闻形式发布的网站
        WebSite webSite = webSiteFactory.getWebSiteCategory("新闻");
        User user = new User();
        user.setName("tom");
        webSite.use(user);

        //客户要一个博客形式发布的网站
        WebSite webSite2 = webSiteFactory.getWebSiteCategory("博客");
        User user2 = new User();
        user2.setName("jack");
        webSite2.use(user2);

        //客户要一个博客形式发布的网站
        WebSite webSite3 = webSiteFactory.getWebSiteCategory("博客");
        User user3 = new User();
        user3.setName("king");
        webSite3.use(user3);


    }
}
